<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/hardware/sha256.h Source File</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('rp2__common_2hardware__sha256_2include_2hardware_2sha256_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">sha256.h</div></div>
</div><!--header-->
<div class="contents">
<a href="rp2__common_2hardware__sha256_2include_2hardware_2sha256_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright (c) 2024 Raspberry Pi (Trading) Ltd.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> */</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef _HARDWARE_SHA256_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define _HARDWARE_SHA256_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &quot;<a class="code" href="pico_8h.html">pico.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &quot;hardware/structs/sha256.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="comment">// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_HARDWARE_SHA256, Enable/disable hardware_sha256 assertions, type=bool, default=0, group=hardware_sha256</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span><span class="preprocessor">#ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_SHA256</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span><span class="preprocessor">#ifdef PARAM_ASSERTIONS_ENABLED_SHA256 </span><span class="comment">// backwards compatibility with SDK &lt; 2.0.0</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_SHA256 PARAM_ASSERTIONS_ENABLED_SHA256</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_SHA256 0</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#ga08a18381a4c5a7c9f7d0d1b6550621a3">   44</a></span><span class="preprocessor">#define SHA256_RESULT_BYTES 32</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span> </div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#gaaf3089af3667088256de5d352973d5e6">   49</a></span><span class="keyword">enum</span> <a class="code hl_enumeration" href="group__hardware__sha256.html#gaaf3089af3667088256de5d352973d5e6">sha256_endianness</a> {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#ggaaf3089af3667088256de5d352973d5e6af7be52b37d04b7ffbd9ba69ba6cad8fd">   50</a></span>    <a class="code hl_enumvalue" href="group__hardware__sha256.html#ggaaf3089af3667088256de5d352973d5e6af7be52b37d04b7ffbd9ba69ba6cad8fd">SHA256_LITTLE_ENDIAN</a>, </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#ggaaf3089af3667088256de5d352973d5e6a9ed40fa208beaabfc2fc5b8edbd652c1">   51</a></span>    <a class="code hl_enumvalue" href="group__hardware__sha256.html#ggaaf3089af3667088256de5d352973d5e6a9ed40fa208beaabfc2fc5b8edbd652c1">SHA256_BIG_ENDIAN</a>,    </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>};</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="unionsha256__result__t.html">   57</a></span><span class="keyword">typedef</span> <span class="keyword">union </span>{</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>    uint32_t words[<a class="code hl_define" href="group__hardware__sha256.html#ga08a18381a4c5a7c9f7d0d1b6550621a3">SHA256_RESULT_BYTES</a>/4];</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>    uint8_t  bytes[<a class="code hl_define" href="group__hardware__sha256.html#ga08a18381a4c5a7c9f7d0d1b6550621a3">SHA256_RESULT_BYTES</a>];</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>} <a class="code hl_union" href="unionsha256__result__t.html">sha256_result_t</a>;</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#ga4f35e6d85d8991216e9c1edd7e682cc7">   69</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__sha256.html#ga4f35e6d85d8991216e9c1edd7e682cc7">sha256_set_dma_size</a>(uint size_in_bytes) {</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>    uint32_t val;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>    invalid_params_if(HARDWARE_SHA256, size_in_bytes != 1 &amp;&amp; size_in_bytes != 2 &amp;&amp; size_in_bytes != 4);</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>    <span class="keywordflow">if</span> (size_in_bytes == 1) {</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>        val = SHA256_CSR_DMA_SIZE_VALUE_8BIT;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (size_in_bytes == 2) {</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span>        val = SHA256_CSR_DMA_SIZE_VALUE_16BIT;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>        val = SHA256_CSR_DMA_SIZE_VALUE_32BIT;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>    }</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>    <a class="code hl_function" href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a>(&amp;sha256_hw-&gt;csr, val &lt;&lt; SHA256_CSR_DMA_SIZE_LSB, SHA256_CSR_DMA_SIZE_BITS);</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>}</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span> </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#ga21bca5a93ccad014cc890e734c9436eb">   91</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__sha256.html#ga21bca5a93ccad014cc890e734c9436eb">sha256_set_bswap</a>(<span class="keywordtype">bool</span> swap) {</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>    <span class="keywordflow">if</span> (swap) {</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;sha256_hw-&gt;csr, SHA256_CSR_BSWAP_BITS);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;sha256_hw-&gt;csr, SHA256_CSR_BSWAP_BITS);</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>    }</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>}</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span> </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#ga327d4bf2af7a8291cc402c569392b4d7">  104</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__sha256.html#ga327d4bf2af7a8291cc402c569392b4d7">sha256_start</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>    <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;sha256_hw-&gt;csr, SHA256_CSR_START_BITS);</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span>}</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span> </div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#ga7e4f6ab4a7738c38d094ecd4c5ee9839">  117</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__sha256.html#ga7e4f6ab4a7738c38d094ecd4c5ee9839">sha256_is_sum_valid</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>    <span class="keywordflow">return</span> sha256_hw-&gt;csr &amp; SHA256_CSR_SUM_VLD_BITS;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span>}</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span> </div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#ga586dc580abe393a0eb4af052da4f9050">  129</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__sha256.html#ga586dc580abe393a0eb4af052da4f9050">sha256_is_ready</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span>    <span class="keywordflow">return</span> sha256_hw-&gt;csr &amp; SHA256_CSR_WDATA_RDY_BITS;</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span>}</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span> </div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#ga98114068a397971354cd24ae75d051a6">  140</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__sha256.html#ga98114068a397971354cd24ae75d051a6">sha256_wait_valid_blocking</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>    <span class="keywordflow">while</span> (!<a class="code hl_function" href="group__hardware__sha256.html#ga7e4f6ab4a7738c38d094ecd4c5ee9839">sha256_is_sum_valid</a>()) {</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>        <a class="code hl_function" href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a>();</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>    }</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>}</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span> </div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#gaab29e83e6d914d262e9aaf13ed34f06e">  152</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__sha256.html#gaab29e83e6d914d262e9aaf13ed34f06e">sha256_wait_ready_blocking</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>    <span class="keywordflow">while</span> (!<a class="code hl_function" href="group__hardware__sha256.html#ga586dc580abe393a0eb4af052da4f9050">sha256_is_ready</a>()) {</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span>        <a class="code hl_function" href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a>();</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span>    }</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span>}</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno">  157</span> </div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__sha256.html#ga065f30a83c4d96ea85712a0e22f7a62e">sha256_get_result</a>(<a class="code hl_union" href="unionsha256__result__t.html">sha256_result_t</a> *out, <span class="keyword">enum</span> <a class="code hl_enumeration" href="group__hardware__sha256.html#gaaf3089af3667088256de5d352973d5e6">sha256_endianness</a> endianness);</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span> </div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#gab26b08aabc454e46859d38acdb9afb63">  174</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__sha256.html#gab26b08aabc454e46859d38acdb9afb63">sha256_err_not_ready</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span>    <span class="keywordflow">return</span> sha256_hw-&gt;csr &amp; SHA256_CSR_ERR_WDATA_NOT_RDY_BITS;</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span>}</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span> </div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#gaccd81a57687cf83726d87b5da4e63551">  183</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__sha256.html#gaccd81a57687cf83726d87b5da4e63551">sha256_err_not_ready_clear</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span>    <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;sha256_hw-&gt;csr, SHA256_CSR_ERR_WDATA_NOT_RDY_BITS);</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span>}</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span> </div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#gac7b585e60910cf0e1d927a0824cd0fe1">  194</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keyword">volatile</span> <span class="keywordtype">void</span> *<a class="code hl_function" href="group__hardware__sha256.html#gac7b585e60910cf0e1d927a0824cd0fe1">sha256_get_write_addr</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>    <span class="keywordflow">return</span> &amp;sha256_hw-&gt;wdata;</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span>}</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span> </div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#ga7d391fa299a4e4f91c591c2e27c82295">  203</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__sha256.html#ga7d391fa299a4e4f91c591c2e27c82295">sha256_put_word</a>(uint32_t word) {</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno">  204</span>    sha256_hw-&gt;wdata = word;</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span>}</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span> </div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"><a class="line" href="group__hardware__sha256.html#gaa78f58e44c56c61c3e24c119923f28d4">  212</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__sha256.html#gaa78f58e44c56c61c3e24c119923f28d4">sha256_put_byte</a>(uint8_t b) {</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span>    *((io_rw_8*)&amp;sha256_hw-&gt;wdata) = b;</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span>}</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span>}</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span> </div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="agroup__hardware__base_html_ga625e737a57f12211cf1f634ca5095ae4"><div class="ttname"><a href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a></div><div class="ttdeci">static __force_inline void hw_set_bits(io_rw_32 *addr, uint32_t mask)</div><div class="ttdoc">Atomically set the specified bits to 1 in a HW register.</div><div class="ttdef"><b>Definition:</b> address_mapped.h:135</div></div>
<div class="ttc" id="agroup__hardware__base_html_ga81b27e30abef56fe090d22fd8dfdbcc1"><div class="ttname"><a href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a></div><div class="ttdeci">static __force_inline void hw_write_masked(io_rw_32 *addr, uint32_t values, uint32_t write_mask)</div><div class="ttdoc">Set new values for a sub-set of the bits in a HW register.</div><div class="ttdef"><b>Definition:</b> address_mapped.h:171</div></div>
<div class="ttc" id="agroup__hardware__base_html_gafd1c089df868d987daf95870b501c2ed"><div class="ttname"><a href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a></div><div class="ttdeci">static __force_inline void hw_clear_bits(io_rw_32 *addr, uint32_t mask)</div><div class="ttdoc">Atomically clear the specified bits to 0 in a HW register.</div><div class="ttdef"><b>Definition:</b> address_mapped.h:145</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_ga065f30a83c4d96ea85712a0e22f7a62e"><div class="ttname"><a href="group__hardware__sha256.html#ga065f30a83c4d96ea85712a0e22f7a62e">sha256_get_result</a></div><div class="ttdeci">void sha256_get_result(sha256_result_t *out, enum sha256_endianness endianness)</div><div class="ttdoc">Get the checksum result.</div><div class="ttdef"><b>Definition:</b> sha256.c:9</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_ga08a18381a4c5a7c9f7d0d1b6550621a3"><div class="ttname"><a href="group__hardware__sha256.html#ga08a18381a4c5a7c9f7d0d1b6550621a3">SHA256_RESULT_BYTES</a></div><div class="ttdeci">#define SHA256_RESULT_BYTES</div><div class="ttdoc">Size of a sha256 result in bytes.</div><div class="ttdef"><b>Definition:</b> sha256.h:44</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_ga21bca5a93ccad014cc890e734c9436eb"><div class="ttname"><a href="group__hardware__sha256.html#ga21bca5a93ccad014cc890e734c9436eb">sha256_set_bswap</a></div><div class="ttdeci">static void sha256_set_bswap(bool swap)</div><div class="ttdoc">Enable or disable byte swapping of 32-bit values.</div><div class="ttdef"><b>Definition:</b> sha256.h:91</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_ga327d4bf2af7a8291cc402c569392b4d7"><div class="ttname"><a href="group__hardware__sha256.html#ga327d4bf2af7a8291cc402c569392b4d7">sha256_start</a></div><div class="ttdeci">static void sha256_start(void)</div><div class="ttdoc">Prepare the hardware for a new checksum.</div><div class="ttdef"><b>Definition:</b> sha256.h:104</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_ga4f35e6d85d8991216e9c1edd7e682cc7"><div class="ttname"><a href="group__hardware__sha256.html#ga4f35e6d85d8991216e9c1edd7e682cc7">sha256_set_dma_size</a></div><div class="ttdeci">static void sha256_set_dma_size(uint size_in_bytes)</div><div class="ttdoc">Configure the correct DMA data size.</div><div class="ttdef"><b>Definition:</b> sha256.h:69</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_ga586dc580abe393a0eb4af052da4f9050"><div class="ttname"><a href="group__hardware__sha256.html#ga586dc580abe393a0eb4af052da4f9050">sha256_is_ready</a></div><div class="ttdeci">static bool sha256_is_ready(void)</div><div class="ttdoc">Check if a the hardware is ready to accept more data.</div><div class="ttdef"><b>Definition:</b> sha256.h:129</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_ga7d391fa299a4e4f91c591c2e27c82295"><div class="ttname"><a href="group__hardware__sha256.html#ga7d391fa299a4e4f91c591c2e27c82295">sha256_put_word</a></div><div class="ttdeci">static void sha256_put_word(uint32_t word)</div><div class="ttdoc">Write one 32bit word of data to the SHA-256 hardware.</div><div class="ttdef"><b>Definition:</b> sha256.h:203</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_ga7e4f6ab4a7738c38d094ecd4c5ee9839"><div class="ttname"><a href="group__hardware__sha256.html#ga7e4f6ab4a7738c38d094ecd4c5ee9839">sha256_is_sum_valid</a></div><div class="ttdeci">static bool sha256_is_sum_valid(void)</div><div class="ttdoc">Check if a valid checksum has been calculated.</div><div class="ttdef"><b>Definition:</b> sha256.h:117</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_ga98114068a397971354cd24ae75d051a6"><div class="ttname"><a href="group__hardware__sha256.html#ga98114068a397971354cd24ae75d051a6">sha256_wait_valid_blocking</a></div><div class="ttdeci">static void sha256_wait_valid_blocking(void)</div><div class="ttdoc">Wait until the checksum is valid.</div><div class="ttdef"><b>Definition:</b> sha256.h:140</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_gaa78f58e44c56c61c3e24c119923f28d4"><div class="ttname"><a href="group__hardware__sha256.html#gaa78f58e44c56c61c3e24c119923f28d4">sha256_put_byte</a></div><div class="ttdeci">static void sha256_put_byte(uint8_t b)</div><div class="ttdoc">Write one byte of data to the SHA-256 hardware.</div><div class="ttdef"><b>Definition:</b> sha256.h:212</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_gaab29e83e6d914d262e9aaf13ed34f06e"><div class="ttname"><a href="group__hardware__sha256.html#gaab29e83e6d914d262e9aaf13ed34f06e">sha256_wait_ready_blocking</a></div><div class="ttdeci">static void sha256_wait_ready_blocking(void)</div><div class="ttdoc">Wait until the hardware is ready to accept more data.</div><div class="ttdef"><b>Definition:</b> sha256.h:152</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_gaaf3089af3667088256de5d352973d5e6"><div class="ttname"><a href="group__hardware__sha256.html#gaaf3089af3667088256de5d352973d5e6">sha256_endianness</a></div><div class="ttdeci">sha256_endianness</div><div class="ttdoc">SHA-256 endianness definition used in the API.</div><div class="ttdef"><b>Definition:</b> sha256.h:49</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_gab26b08aabc454e46859d38acdb9afb63"><div class="ttname"><a href="group__hardware__sha256.html#gab26b08aabc454e46859d38acdb9afb63">sha256_err_not_ready</a></div><div class="ttdeci">static bool sha256_err_not_ready(void)</div><div class="ttdoc">Check if data was written before the hardware was ready.</div><div class="ttdef"><b>Definition:</b> sha256.h:174</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_gac7b585e60910cf0e1d927a0824cd0fe1"><div class="ttname"><a href="group__hardware__sha256.html#gac7b585e60910cf0e1d927a0824cd0fe1">sha256_get_write_addr</a></div><div class="ttdeci">static volatile void * sha256_get_write_addr(void)</div><div class="ttdoc">Address to write the data to be hashed.</div><div class="ttdef"><b>Definition:</b> sha256.h:194</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_gaccd81a57687cf83726d87b5da4e63551"><div class="ttname"><a href="group__hardware__sha256.html#gaccd81a57687cf83726d87b5da4e63551">sha256_err_not_ready_clear</a></div><div class="ttdeci">static void sha256_err_not_ready_clear(void)</div><div class="ttdoc">Clear the &quot;not ready&quot; error condition.</div><div class="ttdef"><b>Definition:</b> sha256.h:183</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_ggaaf3089af3667088256de5d352973d5e6a9ed40fa208beaabfc2fc5b8edbd652c1"><div class="ttname"><a href="group__hardware__sha256.html#ggaaf3089af3667088256de5d352973d5e6a9ed40fa208beaabfc2fc5b8edbd652c1">SHA256_BIG_ENDIAN</a></div><div class="ttdeci">@ SHA256_BIG_ENDIAN</div><div class="ttdoc">Big Endian.</div><div class="ttdef"><b>Definition:</b> sha256.h:51</div></div>
<div class="ttc" id="agroup__hardware__sha256_html_ggaaf3089af3667088256de5d352973d5e6af7be52b37d04b7ffbd9ba69ba6cad8fd"><div class="ttname"><a href="group__hardware__sha256.html#ggaaf3089af3667088256de5d352973d5e6af7be52b37d04b7ffbd9ba69ba6cad8fd">SHA256_LITTLE_ENDIAN</a></div><div class="ttdeci">@ SHA256_LITTLE_ENDIAN</div><div class="ttdoc">Little Endian.</div><div class="ttdef"><b>Definition:</b> sha256.h:50</div></div>
<div class="ttc" id="agroup__pico__platform_html_gab0d1ba75ceb64131e19f613d7a5313c9"><div class="ttname"><a href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a></div><div class="ttdeci">static __force_inline void tight_loop_contents(void)</div><div class="ttdoc">No-op function for the body of tight loops.</div><div class="ttdef"><b>Definition:</b> platform.h:67</div></div>
<div class="ttc" id="apico_8h_html"><div class="ttname"><a href="pico_8h.html">pico.h</a></div></div>
<div class="ttc" id="aunionsha256__result__t_html"><div class="ttname"><a href="unionsha256__result__t.html">sha256_result_t</a></div><div class="ttdoc">SHA-256 result generated by the API.</div><div class="ttdef"><b>Definition:</b> sha256.h:57</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>